<script type="text/javascript" src="<?php echo $this->util()->getPath(); ?>js/reportes/predio.js"></script>

<input type="hidden" id="txtCodmvia" value=''/> 
<div id="panelbusqueda" align="center" class="ui-widget ui-widget-content ui-corner-all "  style="width: 1000px;margin: 3px;">
    <div class="ui-widget ui-state-default ui-corner-top ui-title">
        <label>Predios</label>
    </div>
    <div id="dvbusqueda">
    <table border="0" width="85%">
          <tr>
              <td colspan="15" align="center">

          </tr>
          <tr>
                            <td>&nbsp;</td>
                            <td width="90">C&oacute;digo Predial:</td>
                         
                            <td width="290">Centro Poblado:</td>
                            <td>&nbsp;</td>
                            <td>Via:</td>
                            <td>&nbsp;</td>
                            <td width="50">Nro:</td>
                            <td width="10">&nbsp;</td>
                            <td width="50">Mza:</td>
                            <td width="10">&nbsp;</td>
                            <td width="50">Lote:</td>
                            <td>&nbsp;</td>
                              <td rowspan="2" align="center" valign="bottom">
                            <button id="btnbuscar">Buscar</button>    
                              <button id="btnImprimir">Imprimir</button>             
                            </td>
            </tr>
            <tr id="panelPredio">
                            <td>&nbsp;</td>
                            <td><input class="ui-text" id="c_predial" maxlength="10" style="width:90px" /></td>
                            <td colspan="3"><input class="ui-text pnl" id="c_viacontrib" style="width:100%" /></td>
                            <td>&nbsp;</td><!--
<!--                            <td width="50"><select class="ui-text pnl" id="c_nroviacontrib" ><?php echo $this->util()->getComboContenedorOtro('1000000530', '1000000564','public.obtener_tabla_otro' ); ?>  </select> </td>-->
                            <td width="50"><input class="ui-text pnl" id="c_nroviacontrib" /> </td>
                            <td width="10">&nbsp;</td>
                            <td width="50"><input class="ui-text pnl" id="c_mzacontrib" style="width:100%" /></td>
                            <td width="10">&nbsp;</td>
                            <td width="50"><input class="ui-text pnl" id="c_lotecontrib" style="width:100%" /></td>
                            <td>&nbsp;</td>
                            
             </tr>
		
    </table>
    </div>
    <div id="dvaccion"></div>
</div>
<div id="panelResultmPredio">
	<table id="tblResultmPredio"></table>
	<div id="ptblResultmPredio"></div>
</div>

<script type="text/javascript">

$(function(){


	$("#c_predial").val('');
	$("#c_viacontrib").val('');
	$("#c_nroviacontrib").val('');
	$("#c_mzacontrib").val('');
	$("#c_lotecontrib").val('');
	
	var  pathReport="<?php echo $this->util()->getPathReport(); ?>";  

		$("#btnImprimir").button({
		       icons: {primary:'ui-icon-calculator'}
		   }).bind('click', function(){
		       // location.href = path + "registro";
		           
		window.open(pathReport+"reporte=rptpredios&opt=p_ccodpre^" + $("#c_predial").val() + "|p_ccodvia^"+$("#c_viacontrib").val()+"|p_cnrovia^" + $("#c_nroviacontrib").val()+"|p_cmanzan^"+$("#c_mzacontrib").val()+ "|p_cnrlote^"+$("#c_lotecontrib").val()); 

			   });
	   
			
	var jsonVias = <?php echo json_encode($this->mviascp); ?>,
	        ccodvia = '';
	        cpoblad = '';

	    $("#c_viacontrib").autocompleteCategory({
	        delay: 0,
	        source: jsonVias,
	        minLength: 4,
	        select: function(event, ui) {
	            ccodvia = ui.item.ccodvia;
	            //cpoblad = ui.item.mpoblad;

	            $("#txtCodmvia").val(ccodvia);
	            //$("#txt_mpoblad").val(cpoblad);
	        },
	        change: function(event, ui) {
	            if(ui.item) {
	                ccodvia = ui.item.ccodvia;
	            } else {
	                if($(this).val().length > 0) {
	                    openDialogWarning("El valor ingresado no esta en la lista de elementos.", 380, 150);
	                }
	            }
	        }
	    });
   
  });
  
</script>
<!-- --------------------------------------------------------------------------------------------------------------------	 -->